/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/3/19
 * Time: 17:34
 * Description: No Description
 */
public class Yee {
    public int divide(int dividend, int divisor) {
        int num = 0;
        if(dividend == Integer.MIN_VALUE) {
            if(divisor == 1) {
                return Integer.MIN_VALUE;
            }
            if(divisor == -1) {
                return Integer.MAX_VALUE;
            }
        }

        boolean x = (dividend ^ divisor) >= 0;
        long n = 0;
        n = Math.abs((long)dividend);
        long k = 0;
        k =Math.abs((long)divisor);


        for(int i = 31 ;i >= 0; i--) {
            if((n >> i) >= k) {
                num += 1<<i;
                n -= k << i;
            }
        }
        return x  ? num : -num;
    }
    public static void add(double x ,double y) {
        System.out.println(x + y);
    }
    public static int add(int x ,int y) {
        return x+y;
    }
    public static void main(String[] args) {
        int ret = add(10,20);

    }
}